package com.xinsoft.entity.dto;

import cn.hutool.core.util.ObjectUtil;
import com.xinsoft.entity.po.SysDept;
import lombok.Data;

/**
 *  @author: π
 *  部门
 */
@Data
public class KisDepartDto {

    private String FItemId;
    private String FParentId;
    private String FNumber;
    private String FName;
    private String FManager;
    private String FManager_FName;
    private String FPhone;
    private String FFax;
    private String FDProperty;
    private String FDProperty_FName;



//                "FItemId":"内码"
//                        "FNumber":"编码"
//                        "FParentId":"父类部门"
//                        "FName":"名称"
//                        "FManager":"部门主管"
//                        "FManager_FName":"部门主管"
//                        "FPhone":"部门电话"
//                        "FFax":"传真"
//                        "FDProperty":"部门属性"
//                        "FDProperty_FName":"部门属性"

    public  static SysDept voToPo(KisDepartDto vo) {
        if (vo == null) {
            return null;
        }
        SysDept sysDept = new SysDept();
        sysDept.setId(new Integer(vo.getFItemId()));
        sysDept.setParentId(ObjectUtil.isEmpty(vo.getFParentId()) ? null : new Integer(vo.getFParentId()));
        sysDept.setDeptName(vo.getFName());
        sysDept.setDeptCode(vo.getFNumber());
        sysDept.setDeptLeader(ObjectUtil.isEmpty(vo.getFManager()) ? null : new Integer(vo.getFManager()));
        sysDept.setOfficePhone(vo.getFPhone());
        return sysDept;
    }
}
